import 'package:flutter/material.dart';
import 'package:flutter_app/components/layout.dart';
import 'package:flutter_app/utils/AppUtil.dart';

class GoogleStep2 extends StatefulWidget {
  @override
  _GoogleStep2State createState() => _GoogleStep2State();
}

class _GoogleStep2State extends State<GoogleStep2> {
  String key='SSASSAJWUUEE;QKWLQW';
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: DarkHeadBar('谷歌验证码'),
        body: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 20.0),
          child: Column(
            children: [
              Expanded(
                  child: Column(
                children: [
                  SizedBox(
                    height: 100,
                  ),
                  Image.asset('assets/images/ic_ga_backup_key.png',width: 80,),
                  SizedBox(
                    height: 25,
                  ),
                  Text(
                    '请备份您的秘钥',
                    style: TextStyle(fontWeight: FontWeight.w500, fontSize: 16),
                  ),
                  SizedBox(
                    height: 15,
                  ),
                  Text(
                    '您可用该秘钥创建或恢复您的谷歌二次验证。请写下秘钥并保存在安全私密的地方',
                    textAlign: TextAlign.center,
                    style: TextStyle(height: 2),
                  ),
                  SizedBox(
                    height: 15,
                  ),
                  Container(
                    alignment: Alignment.center,
                    padding: EdgeInsets.symmetric(vertical: 10.0,horizontal: 15.0),
                    width: MediaQuery.of(context).size.width,
                    decoration: BoxDecoration(
                      color: Colors.grey.withOpacity(0.1),
                      borderRadius: BorderRadius.all(Radius.circular(20))
                    ),
                    child: Text(key,style: TextStyle(color: Colors.grey),),
                  ),
                  SizedBox(
                    height: 10,
                  ),
                  TextButton(
                    onPressed: (){AppUtil.copy(key);},
                    child: Text('复制秘钥',style: TextStyle(color: Colors.blueAccent),),
                  ),
                ],
              )),
              FlatButton(
                  minWidth: MediaQuery.of(context).size.width,
                  onPressed: () {
                    Navigator.pushNamed(context, '/google/step3');
                  },
                  color: Colors.blueAccent,
                  textColor: Colors.white,
                  child: Text('下一步'))
            ],
          ),
        ));
  }
}
